package ex;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;

/**
 * @author wzby
 * @Date: 2022/8/2 11:03
 */
public class Ex2 {
      // 文件复制
    public static void main(String[] args)  {
        String f = "mysrc.txt";
        try(FileInputStream fis = new FileInputStream(f);
        FileOutputStream fos = new FileOutputStream("ch09/src/f/ex.txt");)
        {
            //fos.write(fis.readAllBytes());
            byte [] zj = new byte[463];
             int l = 0;
             while( (l = fis.read(zj))  != -1){
                 fos.write(zj,0,l);
        }
        }catch (Exception e){
            throw new RuntimeException(e);
        }
    }
}
